import 'package:atcflutter/widget/root_widget.dart';
import 'package:flutter/material.dart';

import 'widget/bench_head_widget.dart';
import 'widget/bench_schedule_widget.dart';

/// 工作台
class WorkBenchPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return WorkBenchState();
  }
}

class WorkBenchState extends State<WorkBenchPage> {
  List<Widget> widgetList;

  @override
  void initState() {
    super.initState();
    widgetList = [BenchHeadWidget(), BenchScheduleWidget()];
  }

  @override
  Widget build(BuildContext context) {
    return RootWidget(
        appBar: AppBar(title: Text("工作台"),),
        builder: (context, size) {
          return RefreshIndicator(
              onRefresh: _onRefresh,
              child: ListView(
                children: widgetList,
              ));
        });
  }

  Future<void> _onRefresh() {
    return Future.delayed(Duration(seconds: 2), () {});
  }
}
